<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div id="app">
      <h1>{{msg}}</h1>
      <button @click='update1'>update</button>
      <button @click='destroy1'>destroy</button>
  </div>
  <script src="./vue.js"></script>
  <script>
    var vm = new Vue({
      el:'#app',
      data:{
          msg:"hello vue"
      },
      methods:{
        update1() {
            this.msg = 'changed'
        },
        destroy1() {
            this.$destroy()
        }

      },
      beforeCreate() {
          console.log('beforeCreate');
          console.log(this.$el);
          console.log(this.$data);
      },
      created() {
          console.log('---------------');
          console.log('created');
          console.log(this.$el);
          console.log(this.$data);
      },
      beforeMount() {
          console.log('---------------');
          console.log('beforeMount');
          console.log(this.$el);
          console.log(this.$data);
      },
      mounted() {
          console.log('---------------');
          console.log('mounted');
          console.log(this.$el);
          console.log(this.$data);
      },
      beforeUpdate() {
          console.log('---------------');
          console.log('beforeUpdate');
          console.log(this.$el);
          console.log(this.$data);
      },
      updated() {
          console.log('---------------');
          console.log('updated');
          console.log(this.$el);
          console.log(this.$data);
      },
      beforeDestroy() {
          console.log('---------------');
          console.log('beforeDestroy');
          console.log(this.$el);
          console.log(this.$data);
      },
      destroyed() {
          console.log('---------------');
          console.log('destroyed');
          console.log(this.$el);
          console.log(this.$data);
      },
     });
  </script>
</body>
</html>
